package com.china.api.wechat;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * spring 容器初始化类
 * 
 * @author Ben
 * 
 */
public class SpringContext {
	
	private static Logger log = LoggerFactory.getLogger(SpringContext.class);
	private static ClassPathXmlApplicationContext context;
	static {
		context = new ClassPathXmlApplicationContext(
				new String[] { "applicationContext.xml" });
		context.start();
	}

	public static Object getBean(String name) {
		return context.getBean(name);
	}
	
	public static void init(){
		log.info("SpringContext inited.");
	}

}
